#!/usr/bin/env python

import gtk
import gettext
import constants
from mxit import handles
from blend import const
from signals import addGroupDialogSignals

gettext.install('blendIT','locale');

class addGroupDialog(gtk.Dialog):

   def __init__(self,blend,window):
      gtk.Dialog.__init__(self,_("Add New Group"),
                          window,
                          gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                          (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
                          gtk.STOCK_ADD, gtk.RESPONSE_ACCEPT));

      self.set_icon_from_file(constants.IMG_Group);
      
      sigs = addGroupDialogSignals.signals(blend);
      self.connect('response',sigs.on_response,self);
      
      self.drawDialog();

      def sig(widget): widget.destroy();
      self.connect('close',sig);
      self.set_border_width(4);


   def drawDialog(self):
      vbox = gtk.VBox();
      descText = gtk.Label(_("Enter a new group name below to create a group."));
      descText.show();

      text = gtk.Label(_("Group Name:"));
      text.show();
      
      self.entry = gtk.Entry();
      self.entry.show();
      
      table = gtk.Table(rows=1,columns=2);
      table.attach(text,0,1,0,1,gtk.FILL);
      table.attach(self.entry,1,2,0,1,gtk.EXPAND|gtk.FILL);
      table.show();

      vbox.pack_start(text,True,True);
      vbox.pack_start(table);
      vbox.set_spacing(8);
      vbox.show();

      self.vbox.pack_start(vbox,True,True,0);
      